// 获取url参数
function getQueryString(name) {
    var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
    var r = decodeURI(window.location.search).substr(1).match(reg);
    if (r != null) {
        return unescape(r[2]);
    }
    return null;
}
// 改变tab页签
var currenTab = 'tab-item-1'
function changeTab(target, item) {
    if (target === currenTab) return
    $(item).siblings().removeClass('tab-chosen')
    $(item).addClass('tab-chosen')
    $('.' + currenTab).hide()
    $('.' + target).show()
    currenTab = target
}
$(document).ready(function () {
    var showDelay
    var hiddenDelay
    $("header").mouseenter(function () {
        clearTimeout(showDelay)
        clearTimeout(hiddenDelay)
        showDelay = setTimeout(function () {
            $(".subnav").slideDown()
        }, 150)
    })
    $("header").mouseleave(function () {
        clearTimeout(showDelay)
        clearTimeout(hiddenDelay)
        hiddenDelay = setTimeout(function () {
            $(".subnav").slideUp()
        }, 150)
    })
})